package cn.yunyichina.provider.report.component;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import javax.validation.Validation;
import javax.validation.Validator;

/**
 * Created by Lullaby on 2017/9/29
 */
@Component
public class HibernateValidator {

    @Bean
    public Validator validator() {
        return Validation
                .byDefaultProvider()
                .configure()
                .messageInterpolator(new DefaultMessageInterpolator())
                .buildValidatorFactory().getValidator();
    }

}
